package weather.gui;

import java.io.*;

import javax.swing.JFrame;

import weather.dictionary.*;

public class StartApplication 
{
	public static void main(String[] args)
	{
		loadDictionaries();
		MainFrame mf = new MainFrame();
		mf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		mf.setVisible(true);
	}

	private static void loadDictionaries()
	{
		try
		{
			ConditionsGroupsAnswersDictionary.instance().loadFromXlsFile(new File("resources/dict/group_answers.xls"), 0);
			ConditionAnswersDictionary.instance().loadFromXlsFile(new File("resources/dict/condition_answers.xls"), 0);
			ConditionsDictionary.instance().loadFromXlsFile(new File("resources/dict/conditions.xls"), 0);
			SiteNamesDictionary.instance().loadFromXlsFile(new File("resources/dict/site_names.xls"), 0);
			SiteToQueryMappingDictionary.instance().loadFromXlsFile(new File("resources/dict/site_to_query.xls"), 0);
			WeatherKeywordsDictionary.instance().loadFromXlsFile(new File("resources/dict/weather_keywords.xls"), 0);
			TemperatureGroupsDictionary.instance().loadFromXlsFile(new File("resources/dict/temperature_groups.xls"), 0);
			ConditionGroupsDictionary.instance().loadFromXlsFile(new File("resources/dict/condition_groups.xls"), 0);
		}
		catch (IOException e)
		{
			e.printStackTrace();
		}
	}
}
